<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Handsontable for Angular example</title>
  <base href=".">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script>
    (function () {
      const urlParams = new URLSearchParams(window.location.search);
      const theme = urlParams.get('theme');
      const baseLink = document.createElement('link');
      const themeLink = document.createElement('link');

      baseLink.rel = 'stylesheet';
      themeLink.rel = 'stylesheet';

      if (theme === 'main' || theme === 'main-dark') {
        baseLink.href = `/assets/handsontable/styles/handsontable.css`;
        themeLink.href = `/assets/handsontable/styles/ht-theme-main.css`;

      } else if (theme === 'horizon' || theme === 'horizon-dark') {
        baseLink.href = `/assets/handsontable/styles/handsontable.css`;
        themeLink.href = `/assets/handsontable/styles/ht-theme-horizon.css`;

      } else {
        baseLink.href = `/assets/handsontable/dist/handsontable.full.css`;
      }

      [baseLink, themeLink].forEach((link) => {
        if (link.href) {
          document.head.appendChild(link);
        }
      });
    })();
  </script>
</head>
<body>
  <app-root></app-root>
</body>
</html>
